package com.zhonghui.service.impl;

import com.zhonghui.common.core.result.FwResult;
import com.zhonghui.mapper.UserAddressMapper;
import com.zhonghui.model.UserAddress;
import com.zhonghui.service.UserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserAddressServiceImpl implements UserAddressService {

    @Autowired
    private UserAddressMapper userAddressMapper;
    @Override
    public FwResult<UserAddress> select(String userId) {
        UserAddress userAddress=  userAddressMapper.select(userId);
        return FwResult.ok(userAddress);
    }


    @Override
    public FwResult<UserAddress> delete(String userId) {
        userAddressMapper.delete(userId);
        return FwResult.okMsg("删除成功");
    }

    @Override
    public FwResult<UserAddress> insert(UserAddress userAddress) {
        userAddressMapper.insert(userAddress);
        return FwResult.okMsg("添加成功");
    }

    @Override
    public FwResult<UserAddress> update(String userId) {
        userAddressMapper.update(userId);
        return FwResult.okMsg("修改成功");
    }
}
